package com.app.teaware.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

public class GoodsListBean extends BaseListBean {



    private ArrayList<GoodsListData> list = new ArrayList<GoodsListData>();

    public ArrayList<GoodsListData> getList() {
        return list;
    }

    public void setList(ArrayList<GoodsListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(GoodsListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<GoodsListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public List<String> getAllNameList(){
        List<String> nameList = new ArrayList<>();
        if (list.size()>0){
            for (GoodsListData data : list){
                nameList.add(data.getSna());
            }
        }
        return nameList;
    }

    public GoodsListData getCompanyByChoose(int position){
        return list.get(position);
    }

}
